Markup |
<apex:page showHeader="false" sidebar="false" standardController="WorkOrderLineItem" extensions="FSL.ctrl0998_WorkOrderLineItemLightbox" >
<apex:includeScript value="{!$Resource.FSL__jQuery}" />
<script>
$(function() {
$('.btn').hide();
var newServiceId = '{!WorkOrderLineItem.Id}';
var newServiceName = '{!WorkOrderLineItem.LineItemNumber}';
window.parent.$('#CreateServiceLightboxHeader h1').text('Work Order ' + newServiceName + ':');
if (window.parent.sforce.console.isInConsole()) {
//window.parent.openConsoleTab()
var allLinks = $('a');
for (var i=0; i<allLinks.length; i++) {
(function(j) {
$(allLinks[j]).on('click',{ url: $(allLinks[j]).attr('href') },function(e) {
e.preventDefault();
window.parent.openConsoleTabFromModal(e.data.url);
return;
});
}(i));
}
return;
}
$('a').attr('target','_blank');
$('a').on('mouseover',function() {
$(this).attr('target','_blank');
});
window.navigateToUrl = function(url) {
if (window.parent.sforce.console.isInConsole()) {
window.parent.openConsoleTabFromModal(e.data.url);
} else {
window.open(url);
}
};
// prevent popups on lookup fields
window.LookupHoverDetail.getHover = function() {
return {
show: function() {},
hide: function() {},
}
};
handleLinks();
});
function handleLinks() {
var allLinks = $('a');
allLinks.off('click');
// console links
if (window.parent.sforce.console.isInConsole()) {
for (var i=0; i<allLinks.length; i++) {
var currentLink = $(allLinks[i]);
// if the "show X more" is clicked, need to reattch handles as the DOM is destroyed and rebuilt
if ((currentLink.attr('href')) && ((currentLink.attr('href').indexOf('showMoreList') > -1))) {
(function(j) {
$(allLinks[j]).off('click');
$(allLinks[j]).on('click',{ url: $(allLinks[j]).attr('href') },function(e) {
setTimeout(handleLinks,500);
setTimeout(handleLinks,1500);
setTimeout(handleLinks,3000);
return;
});
}(i));
continue;
}
// if link is "del" or "show X more"
if ((currentLink.attr('href')) && ((currentLink.attr('href').indexOf('delete') > -1)))
continue;
// normal link
(function(j) {
$(allLinks[j]).off('click');
$(allLinks[j]).on('click',{ url: $(allLinks[j]).attr('href') },function(e) {
e.preventDefault();
window.parent.openConsoleTabFromModal(e.data.url);
return;
});
}(i));
}
return;
}
// normal, tabbed view
for (var i=0; i<allLinks.length; i++) {
var currentLink = $(allLinks[i]);
// if the "show X more" is clicked, need to reattch handles as the DOM is destroyed and rebuilt
if ((currentLink.attr('href')) && ((currentLink.attr('href').indexOf('showMoreList') > -1))) {
(function(j) {
$(allLinks[j]).on('click',{ url: $(allLinks[j]).attr('href') },function(e) {
setTimeout(handleLinks,500);
setTimeout(handleLinks,1500);
setTimeout(handleLinks,3000);
return;
});
}(i));
continue;
}
// if link is "del" or "show X more"
if ((currentLink.attr('href')) && ((currentLink.attr('href').indexOf('delete') > -1)))
continue;
currentLink.attr('target','_blank');
}
window.navigateToUrl = function(url) {
if (window.parent.sforce.console.isInConsole()) {
window.parent.openConsoleTabFromModal(e.data.url);
} else {
window.open(url);
}
};
// prevent popups on lookup fields
window.LookupHoverDetail.getHover = function() {
return {
show: function() {},
hide: function() {},
}
};
}
</script>
<style>
body .bPageBlock {
background: #fff !important;
border: 0 !important;
}
input[type=submit] {
margin-left: 130px !important;
padding: 6px 10px !important;
}
input[type=submit]:last-child {
margin-left: 6px !important;
}
.pbSubheader h3 {
display: inline-block;
}
</style>
<div id="CKSW_AccountDetailsForm">
<apex:form >
<apex:pageBlock mode="detail">
<apex:pageBlockSection columns="2">
<apex:repeat value="{!$ObjectType.WorkOrderLineItem.FieldSets.FSL__CrewManagment_Lightbox}" var="d">
<apex:outputField value="{!WorkOrderLineItem[d]}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
<br/><br/>
<apex:pageBlock mode="maindetail">
<apex:relatedList list="SkillRequirements"/>
<!--<apex:relatedList list="ResourcePreferences"/>-->
<apex:relatedList list="ServiceAppointments"/>
</apex:pageBlock>
</div>
</apex:page> |